<!--结构化内容块管理-->
<template>
  <div class="editor-business-page row-flex">
    <leftTree
      :addPermi="['editor:documentBlockClassify:add']"
      :editPermi="['editor:documentBlockClassify:edit']"
      :removePermi="['editor:documentBlockClassify:remove']"
      :fetchMethod="getBlockTree"
      :deleteMethod="deleteBlockTreeNode"
      :handleTreeNode="handleBlockTreeNode"
      @updateSelectedNode="updateSelectedNode"
    />
    <div class="content">
      <rightContent :selectedNode="selectedNode" />
    </div>
  </div>
</template>
<script>
import { getBlockTree, deleteBlockTreeNode, handleBlockTreeNode } from '@/api/business'
import leftTree from '@/views/editor/__components__/LeftTree.vue'
import rightContent from '@/views/editor/__components__/BlockRightContent.vue'
export default {
  components: { leftTree, rightContent },
  provide() {
    return {
      componentType: 'block',
    }
  },
  data() {
    return {
      selectedNode: {}
    }
  },
  methods: {
    getBlockTree,
    deleteBlockTreeNode,
    handleBlockTreeNode,
    updateSelectedNode(node) {
      this.selectedNode = node
    }
  }
}
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/editor.scss";
.row-flex {
  width: 100%;
  flex-direction: row;
  display: flex;
}
.content {
  flex: 1;
}
</style>
